

#include <iostream>
#include <vector>
#include <string>
using namespace std;

int bitsCnt(void)
{
	int cnt = 0;
	unsigned x = ~0U;

	while (x & 1U)
	{
		++cnt;
		x >>= 1;
	}

	return cnt;
}

void bitsPrint(int x)
{
	int n = bitsCnt();

	int flag = 1;
	for (int i = n-1; i >= 0; --i)
	{
		cout << (((1U << i) & x) == 0 ? 0 : 1);
		if (0 == flag % 8)
			cout << " ";

		++flag;
	}
	cout << endl;
}

class Solution
{
public:
	string modifyString(string s)
	{
		int sz = s.size();

		for (int i = 0; i < sz; ++i)
		{
			if (s[i] == '?')
			{
				for (char ch = 'a'; ch <= 'z'; ++ch)
				{
					if ((0 == i || ch != s[i - 1]) && (sz - 1 == i || ch != s[i + 1]))
					{
						s[i] = ch;
						break;
					}
				}
			}
		}

		return s;
	}

	vector<int> singleNumber(vector<int>& nums)
	{
		int xorsum = 0;
		int a = 0, b = 0;
		int low_bit1 = 0;

		for (const auto& e : nums)
		{
			xorsum ^= e;
		}
		low_bit1 = xorsum == INT_MIN ? INT_MIN : xorsum & (-xorsum);

		for (const auto& e : nums)
		{
			if (e & low_bit1)
				a ^= e;
			else
				b ^= e;
		}

		return { a, b };
	}

	int myAtoi(string s)
	{
		int sz = s.size();

		if (0 == sz)
			return 0;

		int flag = 1;
		int index = 0;
		long long ans = 0;

		while (isblank(s[index]))
		{
			++index;
		}
		if ('-' == s[index] || '+' == s[index])
		{
			if ('-' == s[index])
				flag = -flag;
			++index;
		}
		while (index < sz && '0' == s[index])
		{
			++index;
		}

		if (index < sz)
		{
			while (isdigit(s[index]))
			{
				ans = s[index++] - '0' + ans * 10;

				if (ans * flag > INT_MAX)
				{
					ans = INT_MAX;
					break;
				}
				if (ans * flag < INT_MIN)
				{
					ans = INT_MIN;
					break;
				}
			}
		}
		/*while (index < sz && isdigit(s[index]))
		{
			int digit = s[index] - '0';

			if (flag == 1 && (ans > INT_MAX / 10 || (ans == INT_MAX / 10 && digit >= 7)))
				return INT_MAX;

			if (flag == -1 && (ans > INT_MAX / 10 || (ans == INT_MAX / 10 && digit >= 8)))
				return INT_MIN;

			ans = digit + ans * 10;
			++index;
		}*/

		return ans * flag;
	}
};

int main()
{

	bitsPrint(-25);
	bitsPrint(25);

	return 0;
}